﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CRConsult.Models;

namespace CRConsult.Controllers
{
    public class UserController : Controller
    {
        userRepository userdb = new userRepository();
        //
        // GET: /User/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Logon() {
            return View();
        }

        [HttpPost]
        public ActionResult CheckUser(string username, string password) {
            var isExist = userdb.checkUser(username.Trim(), password.Trim());

            return Json(new { result = isExist }, JsonRequestBehavior.AllowGet);
        }

    }
}
